package com.zhipu.balance.mobile.dao;

import com.raizlabs.android.dbflow.sql.language.SQLite;
import com.zhipu.balance.mobile.event.Number_Table;
import com.zhipu.balance.mobile.event.Number;

import java.util.List;

public class NumberDao {
    private NumberDao() {
    }

    private static final class SingletonHolder {
        private static final NumberDao INSTANCE = new NumberDao();
    }

    public static NumberDao getInstance() {
        return SingletonHolder.INSTANCE;
    }



    /**
     * 获取所有数据
     *
     * @return
     */
    public List<Number> getAllList() {
        return SQLite.select().from(Number.class).where().orderBy(Number_Table.numberId,true).queryList();
    }

    /**
     * 获取编号
     * @return
     */
    public Number acquireNumber(){
        Number mNumber = SQLite.select().from(Number.class).where(Number_Table.select.eq(true)).querySingle();
        return mNumber;
    }
}
